package com.liull.netty.protobuf;

import com.google.protobuf.InvalidProtocolBufferException;

/**
 * @Author: liull
 * @Description:
 * @Date: Created in 21:25 2020/9/26
 * @Modified By:
 */
public class ProtoBufTest {
    public static void main(String[] args) throws InvalidProtocolBufferException {
        DataInfo.Student student = DataInfo.Student.newBuilder().setName("李")
                .setAddress("南京")
                .setAge(15).build();
        byte[] byteArray = student.toByteArray();
        DataInfo.Student student2 = DataInfo.Student.parseFrom(byteArray);
        System.out.println(student == student2);
        System.out.println(student.equals(student2));
        System.out.println(student2);
    }
}
